/*     */ package com.umeng.newxp;
/*     */ 
/*     */ import android.net.Uri;
/*     */ import com.umeng.common.util.h;
/*     */ import com.umeng.newxp.common.g;
/*     */ import org.json.JSONException;
/*     */ import org.json.JSONObject;
/*     */ 
/*     */ public class Promoter
/*     */ {
/*     */   public String promoter;
/*     */   public int category;
/*     */   public int content_type;
/*     */   public int display_type;
/*     */   public String img;
/*     */   public int anim_in;
/*     */   public int landing_type;
/*     */   public String text_font;
/*     */   public String text_size;
/*     */   public String text_color;
/*     */   public String title;
/*     */   public String provider;
/*     */   public String ad_words;
/*     */   public String description;
/*     */   public String icon;
/*     */   public String url;
/*     */   public int app_version_code;
/*     */   public String url_in_app;
/*     */   public long size;
/* 163 */   public String app_package_name = "";
/*     */   public String app_version_name;
/* 174 */   public int new_tip = 0;
/*     */   public double bid;
/*     */   public String price;
/*     */   public static final int LANDING_TYPE_BROWSER = 3;
/*     */   public static final int LANDING_TYPE_DIRECT_DOWNLOAD = 1;
/*     */   public static final int LANDING_TYPE_POPUP = 0;
/*     */   public static final int LANDING_TYPE_WAP_WEBVIEW = 4;
/*     */   public static final int LANDING_TYPE_WEBVIEW = 2;
/*     */   public static final int REPORT_CLICK_TO_LAUNCH_DETAIL_PAGE = 5;
/*     */   public static final int REPORT_CLICK_TO_LAUNCH = 4;
/*     */   public static final int REPORT_CLICK_TO_PROMOTE = 2;
/*     */   public static final int REPORT_DOWNLOAD = 1;
/*     */   public static final int REPORT_DOWNLOAD_CLICK = 3;
/*     */   public static final int REPORT_DOWNLOAD_CLICK_DIRECT = 7;
/*     */   public static final int REPORT_IMPRESSION = 0;
/*     */   public static final int REPORT_FILTERED = -1;
/*     */ 
/*     */   public static Promoter getPromoterFromJson(JSONObject paramJSONObject)
/*     */   {
/* 259 */     if (paramJSONObject == null)
/* 260 */       return null;
/* 261 */     Promoter localPromoter = new Promoter();
/*     */ 
/* 264 */     localPromoter.promoter = paramJSONObject.optString("promoter", "");
/*     */ 
/* 266 */     localPromoter.category = paramJSONObject.optInt("category", 0);
/* 267 */     localPromoter.content_type = paramJSONObject.optInt("content_type");
/* 268 */     localPromoter.display_type = paramJSONObject.optInt(
/* 269 */       "display_type", 0);
/*     */ 
/* 271 */     String str1 = paramJSONObject.optString("img", "");
/* 272 */     if (h.e(str1))
/* 273 */       localPromoter.img = str1;
/*     */     else {
/* 275 */       localPromoter.img = (com.umeng.newxp.common.ExchangeConstants.BASE_URL_LIST[0] + str1);
/*     */     }
/*     */ 
/* 278 */     localPromoter.anim_in = paramJSONObject.optInt("anim_in", 0);
/*     */ 
/* 280 */     localPromoter.landing_type = paramJSONObject.optInt(
/* 281 */       "landing_type", 0);
/*     */ 
/* 284 */     localPromoter.text_size = paramJSONObject.optString("text_size", "");
/* 285 */     localPromoter.text_color = paramJSONObject.optString("text_color");
/* 286 */     localPromoter.text_font = paramJSONObject.optString("text_font");
/*     */ 
/* 288 */     localPromoter.title = paramJSONObject.optString("title", "");
/* 289 */     localPromoter.provider = paramJSONObject.optString("provider", "");
/*     */ 
/* 291 */     localPromoter.ad_words = paramJSONObject.optString("ad_words", "");
/* 292 */     localPromoter.description = paramJSONObject.optString("description", 
/* 293 */       "");
/*     */ 
/* 295 */     str1 = paramJSONObject.optString("icon", "");
/* 296 */     if (h.e(str1))
/* 297 */       localPromoter.icon = str1;
/*     */     else {
/* 299 */       localPromoter.icon = (com.umeng.newxp.common.ExchangeConstants.BASE_URL_LIST[0] + str1);
/*     */     }
/*     */ 
/* 302 */     str1 = paramJSONObject.optString("url", "");
/* 303 */     Uri localUri = Uri.parse(str1);
/* 304 */     String str2 = localUri.getScheme();
/* 305 */     if (h.e(str1))
/* 306 */       localPromoter.url = str1;
/* 307 */     else if ((str2 != null) && (g.a(str2, true, a.a())))
/* 308 */       localPromoter.url = str1;
/*     */     else {
/* 310 */       localPromoter.url = 
/* 311 */         (com.umeng.newxp.common.ExchangeConstants.BASE_URL_LIST[0] + 
/* 311 */         str1);
/*     */     }
/*     */ 
/* 314 */     localPromoter.new_tip = paramJSONObject.optInt("new", 0);
/*     */ 
/* 316 */     localPromoter.app_version_code = paramJSONObject.optInt("app_version_code", 0);
/* 317 */     localPromoter.url_in_app = paramJSONObject.optString("url_in_app");
/*     */ 
/* 319 */     localPromoter.size = paramJSONObject.optLong("size", 0L);
/*     */ 
/* 321 */     localPromoter.app_package_name = paramJSONObject.optString(
/* 322 */       "app_package_name", "");
/*     */ 
/* 324 */     localPromoter.app_version_name = paramJSONObject.optString("app_version_name", "");
/*     */ 
/* 326 */     localPromoter.price = paramJSONObject.optString("price", "");
/* 327 */     localPromoter.bid = paramJSONObject.optDouble("bid", 0.0D);
/* 328 */     return localPromoter;
/*     */   }
/*     */ 
/*     */   public JSONObject toJson() {
/* 332 */     JSONObject localJSONObject = new JSONObject();
/*     */     try {
/* 334 */       localJSONObject.put("promoter", this.promoter);
/* 335 */       localJSONObject.put("category", this.category);
/* 336 */       localJSONObject.put("content_type", this.content_type);
/*     */ 
/* 338 */       localJSONObject.put("display_type", this.display_type);
/* 339 */       localJSONObject.put("img", this.img);
/* 340 */       localJSONObject.put("anim_in", this.anim_in);
/*     */ 
/* 342 */       localJSONObject.put("display_type", this.display_type);
/* 343 */       localJSONObject.put("img", this.img);
/* 344 */       localJSONObject.put("landing_type", this.landing_type);
/*     */ 
/* 346 */       localJSONObject.put("text_size", this.text_size);
/* 347 */       localJSONObject.put("text_color", this.text_color);
/* 348 */       localJSONObject.put("text_font", this.text_font);
/*     */ 
/* 350 */       localJSONObject.put("title", this.title);
/* 351 */       localJSONObject.put("provider", this.provider);
/* 352 */       localJSONObject.put("ad_words", this.ad_words);
/*     */ 
/* 354 */       localJSONObject.put("description", this.description);
/* 355 */       localJSONObject.put("icon", this.icon);
/* 356 */       localJSONObject.put("url", this.url);
/*     */ 
/* 358 */       localJSONObject.put("new", this.new_tip);
/* 359 */       localJSONObject.put("app_version_code", this.app_version_code);
/* 360 */       localJSONObject.put("url_in_app", this.url_in_app);
/*     */ 
/* 362 */       localJSONObject.put("size", this.size);
/* 363 */       localJSONObject.put("app_package_name", this.app_package_name);
/* 364 */       localJSONObject.put("app_version_name", this.app_version_name);
/*     */ 
/* 366 */       localJSONObject.put("price", this.price);
/* 367 */       localJSONObject.put("bid", this.bid);
/*     */ 
/* 369 */       return localJSONObject;
/*     */     } catch (JSONException localJSONException) {
/*     */     }
/* 372 */     return null;
/*     */   }
/*     */ 
/*     */   public static Promoter buildMockPromoter() {
/* 376 */     return new Promoter();
/*     */   }
/*     */ 
/*     */   public static enum a
/*     */   {
/*     */     public static String[] a()
/*     */     {
/*  66 */       a[] arrayOfa = values();
/*  67 */       String[] arrayOfString = new String[arrayOfa.length];
/*  68 */       for (int i = 0; i < arrayOfa.length; i++) {
/*  69 */         arrayOfString[i] = arrayOfa[i].toString();
/*     */       }
/*  71 */       return arrayOfString;
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.newxp.Promoter
 * JD-Core Version:    0.6.2
 */